﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Manager_System
{
    public partial class WH_add_material : Form
    {
        main_form form1;
        public WH_add_material(main_form form)
        {
            form1 = form;
           
            InitializeComponent();
        }

        private void add_bt_Click(object sender, EventArgs e)
        {
            string sql = "";
            
            sql = "insert into T_WH_material (Species,Weight,Price) values ('" + material_name_tb.Text + "','" + weight_tb.Text + "','" + price_tb.Text + "')";
           
            DBhelp db = new DBhelp();
            int rs = db.update(sql);
            if (rs == 1)
            {
                MessageBox.Show("添加成功！");
                
            }
            else
            {
                MessageBox.Show("添加失败！");

            }
            db.close();
            form1.Refresh_warehouse_material_LV();
        }

        private void close_bt_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
